package com.yhb.channel.impl.SXY.ResponseParser.impl;

import com.yhb.channel.impl.SXY.ResponseParser.SXYResponseParser;
import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
public class PayResponse extends SXYResponseParser {
    public enum OrderStatus {
        INIT,
        SUCCESS,
        FAIL,
        FAILED,
        CANCEL
    }

    private String orderId;
    private OrderStatus orderStatus;
    private Status status;

    @Override
    public boolean isOk() {
        boolean orderIsOk = OrderStatus.INIT.equals(this.orderStatus) || OrderStatus.SUCCESS.equals(this.orderStatus);
        return Status.SUCCESS.equals(this.status) && orderIsOk;
    }
}
